package com.tz.farmer.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductInfo implements Serializable {
    /**
     * CREATE TABLE `product_info` (
     *   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
     *   `p_name` varchar(255) DEFAULT NULL COMMENT '产品名称',
     *   `weight` varchar(255) DEFAULT NULL COMMENT '重量',
     *   `create_time` datetime DEFAULT NULL COMMENT '添加时间',
     *   `pick_time` datetime DEFAULT NULL COMMENT '采摘日期',
     *   `lead_id` int(11) DEFAULT NULL COMMENT '主体id',
     *   PRIMARY KEY (`id`)
     * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='产品信息表';
     */

    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "产品名称")
    private String pName;
    @ApiModelProperty(value = "重量")
    private String weight;
    @ApiModelProperty(value = "添加时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "采摘日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8" )
    private Date pickTime;
    @ApiModelProperty(value = "主题信息id")
    private Integer leadId;


    /**
     * 查询需要 商户名称  商户地址
     */
    @TableField(exist = false)
    private String bName;
    @TableField(exist = false)
    private String addr;
    @TableField(exist = false)
    private int zNum;
    @TableField(exist = false)
    private int jNum;
    @TableField(exist = false)
    private int cNum;
    @TableField(exist = false)
    private String city;
    @TableField(exist = false)
    private Integer bId;

}
